home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wildcat Files 2
/
The Wildcat Files 2 (Arsenal Computer).ISO
/
wildcat
/
wc26rec.typ
< prev
next >
Wrap
Text File
|
1992-11-02
|
42KB
|
870 lines
(***************************************************************************
WC26REC.TYP - File and Record locking information for WILDCAT! v2.6
Note, this structure is the same for all 3 versions,
('S', 'N', 'P').
REFERENCE - WILDCAT! supports true record locking. This means a utility,
written correctly, maybe designed to run while other WILDCAT!
nodes are up and accepting calls. This may not be a
requirement, if your utility is simply going to create a
report. The utility would just have to make certain that the
FileMode is opened in Share ReadOnly (40h).
If you want to write full blown WILDCAT! utilities, then
you'll need to purchase the same BTree File Management
package used by us. The Package is called BTree Filer,
and may be purchased directly from:
Turbo Power Software
P.O. Box 49009
Colorado Springs, CO
Voice (719) 260-6641
Orders (800) 333-4160
Fax (719) 260-4160
CompuServe 72457,2131
Please be sure to mention you're a WILDCAT! Sysop when placing
your order.
BACKGROUND - WILDCAT! has undergone a MAJOR REVISION with version 2.0.
Like every version since version 1.0, it is faster and requires
less memory then it predecessor. These improvements do come
at a cost however, the cost is any 3rd party utility written
for WILDCAT! which reads the DATABASE files, will have to be
upgraded. In most cases, all of the Live programs written for
WILDCAT! v1.1x should NOT require any modification.
=============================================================================
RECORD & TYPE
DECLARATION -
=============================================================================
(******************************************************************
Global record structure for WILDCAT! version 2.x.
Copyright 1989,94 Mustang Software Inc. All rights reserved.
Mustang Software, Inc. Voice 805/873-2500
6200 Lake Ming Road BBS 805/873-2400
Bakersfield, CA 93306 CIS GO PCVENA, SS9
******************************************************************)
interface
uses
TpDate, Filer;
(* Note, Unit Filer is from Turbo Powers BTree Filer Product, Unit
TpDate is from Turbo Powers' Turbo Professional Product, which
is not required to create 3rd party utilities, however will assist
you if you're a Turbo Pascal Programmer.
In TPDate, we would find the following record formats:
Time = LongInt; { Numbers of Seconds since midnight }
Date = LongInt; { Number of days since 1/1/1600 }
DateTimeRec = Record { Record which holds a date/time value }
D : Date;
T : Time;
end;
DateString = String[20]; { ie date spelled out in any format }
***********************************************************************)
const
MaxSecLevels = 50;
{------------------ Type Declarations ----------------------}
type
DataBaseProtectionType = (NoProtection, MarkMode, SaveMode);
BBSFileType = (MasterFile, NodeFile, RangeFile, DoorFile);
Password_Type = (NotReq, YesReq, Protect);
Mono_Type = (M_Color, M_Mono, M_Auto);
DetermineBaudType = (ByResult, ByCR);
Closed_Type = (Open, Closed, ClosedComment, ClosedQuestionnaire);
AnswerPhoneType = (ByRing, ByAutoAnswer);
Security_Array = array[1..MaxSecLevels] of String[26];
Transfer_Type = (All, Xmodem, XmodemCRC, Ymodem, YmodemG, Xmodem1K,
Xmodem1KG, ASCii, ExtBatch, Ext1, Ext2, Ext3, Ext4, Ext5, Ext6, Ext7, Ext8,
Ext9, Ext10);
More_Prompt_Type = (Erase_Prompt, Next_Line);
Expertise_Level = (Novice, Regular, Expert);
Logoff_Type = (Normal, Dropped_Carrier, TimeLimit_Exceeded, By_Sysop, No_Activity);
NodeStatusType = (Up, Down, LoggedIn, Crash, EventProcessing, Event60, NetEcho);
ChatStatusType = (Available, Request, UnAvailable, Paged, Group);
UserStatusType = (None, FileTransfer, EnteringMsg, InLive, InDOS, PChat, GChat);
TBaud = (B300, B1200, B2400, B4800, B9600, B19200, B38400, BLocal);
ResultCodeBaud = (R300, R1200, R1200V22, R2400, R9600, R19200);
DoorInfo_Type = record { DOOR.DAT }
Security : Word; { Min Sec for }
MultiUser, { MultiUser Door? }
InUse : Boolean; { is it inuse? }
end; { 4 Bytes }
MasterInfo_Type = record { MASTER.DAT }
Version_Id : String[5]; { Version Number }
ActiveNodes : array[1..250] of Boolean; { List of Active Nodes }
TotalCalls : LongInt; { Total Number of Calls }
end; { 260 Bytes }
MessageInfo_Type = record { MESSAGE.DAT }
ActiveMessages, { Number of active messages }
MsgLow, { Low Message Range }
MsgHigh : LongInt; { High Message Range }
end; { 12 Bytes }
NodeInfo_Type = record { NODEINFO.DAT }
NodeID : Byte; { Node Number }
NodeStatus : NodeStatusType; { Up/Down, Etc.. }
ChatStatus : ChatStatusType; { Available, etc.. }
UserStatus : UserStatusType; { Entering a Message, etc.. }
CallersName : String[37]; { name }
From : String[30]; { city, st }
PrevCaller : String[60]; { Last caller on node }
BaudRate : TBaud; { baud rate }
PrevLogOff, { L/Callers time off }
TimeOff : DateTimeRec; { Time limit expired date/time }
RequestNode, { Node requesting chat }
SecurityLevel : Integer; { callers security level }
PagedDisplayed, { have we told them about their page }
LptrFlag, { node Lptr toggle }
PageFlag, { node page toggle }
BellFlag, {node bell toggle }
KybdFlag, { node Kybd toggle }
LocalNextFlag, { node Local next toggle }
ScreenWriteFlag, { node screen write toggle }
EventNextFlag, { node event next toggle }
BringDown, { node bring down toggle }
KillCaller, { node log caller off toggle }
PagingSysop : Boolean; { node paging sysop flag }
Quote_Index : Word; { Quote file index pointer }
NumberOfCalls : LongInt; { totals calls received by node }
end; { 166 bytes }
MsgHeaderOnly_Type = record { used in vrec unit only }
Status : LongInt; { B-Tree Status }
MessageNumber : Word; { Message Number }
DateTime : DateTimeRec; { Message Date & Time }
From : String[37]; { Who wrote the message }
TO_ : String[37]; { Who is the message to }
Subject : String[37]; { Subject }
Conference : Char; { Conference it is assigned to }
TotalLines : Byte; { Total number of lines }
Referenced, { This message has threads }
Private, { Is the message private }
Forwarded, { Has this message been forwarded }
Receipt, { Return Receipt Requested }
CarbonCopy, { Is this a Carbon Copy }
Received : Boolean; { Has the message been Received}
end;
Message_Type = record { MSGFILE.DAT }
Status : LongInt; { B-Tree Status }
MessageNumber : Word; { Message Number }
DateTime : DateTimeRec; { Message Date & Time }
From : String[37]; { Who wrote the message }
TO_ : String[37]; { Who is the message to }
Subject : String[37]; { Subject }
Conference : Char; { Conference it is assigned to }
TotalLines : Byte; { Total number of lines }
Referenced, { This message has threads }
Private, { Is the message private }
Forwarded, { Has this message been forwarded }
Receipt, { Return Receipt Requested }
CarbonCopy, { Is this a Carbon Copy }
Received : Boolean; { Has the message been Received}
Contents : array[1..150] of String[80];
end; { <vrec> max size 12,292 bytes }
File_Record_Type = record { FILESPEC.DAT }
Status : LongInt; { B-Tree Status }
FileName : String[12]; { Name of the file }
Password : String[14]; { 12 Byte password }
FileDate, { Date of the file }
LastAccessed : DateTimeRec; { Date of last access }
Desc : array[1..2] of String[40]; { Description }
UploadedBy : String[37]; { Who uploaded by }
Area : Char; { file Area it is assigned to }
NumOfAccess, { Number of downloads }
Size : LongInt; { Size of the File }
PasswordReq : Password_Type; { Is a password required }
end; { Size 178 Bytes }
Event_Type = record { SCHED.BBS }
Schedule : Char; { Event Letter }
StartTime : String[5]; { Start Time }
LengthTime : Integer; { Length of the Event }
Active : Boolean; { Is it active }
Day_Active : Byte; {which days 0 = Mon, 1 = Tue... }
end;
Menu_Record_Type = { In CONFIGWC.BBS }
array[1..4] of record
Sec_Level : array[1..19] of Word; { Req Security }
Desc : array[1..19] of String[35]; { Description }
Call_Ltr, ID : array[1..19] of Char; { Internal Call Letter }
Order : array[1..19] of Byte; { Sequence Order }
end;
Config_Record = record {CONFIGWC.BBS}
MWVersion : String[5]; { makewild version }
ModemReSet : String[10]; { Modem Reset String }
SysFirst, { Sysop's First Name }
Syslast : String[15]; { Sysop's Last Name }
OffHook, { Modem Off Hook String }
OnHook : String[20]; { Modem On Hook String }
FirstCall : String[25]; { Date of First Call }
NewUserConfs : String[26]; { New User Default Conf. }
BBSName : String[30]; { Name of the BBS }
StartUp1, { Startup String 1 }
StartUp2, { Startup String 2 }
StartUp3, { Startup String 3 }
Modminit : String[40]; { Reinit String }
BulletinPath, { Bulletin Path }
ProtocolPath, { External Protocol/Batch Path }
MenuPath, { Menu File Paths }
HelpPath, { Help File Paths }
displaypath, { Display File Paths }
MsgDataBasePath, { Message path }
FileDataBasePath, { File path }
UserDataBasePath, { USERINFO.DAT path }
MasterPath, { Master Path }
QuesPath, { Questionnaire path }
DoorPath : String[67]; { Door path }
AnswerPhone : AnswerPhoneType; { Way to answer phone }
DetermineBaud : DetermineBaudType; { how to determine baud rate }
MonitorType : Mono_Type; { Monitor type }
CloseOption : Closed_Type; { Closed Board Options }
Menu : Menu_Record_Type; { menu details }
Network : NetSupportType; { type of network }
DataBaseOpenMode : DataBaseProtectionType; { open mode type }
FileConf, { File Conf. Descriptions }
FilePath, { File Paths }
MessageConf : array[1..26] of String[30]; { Msg Conf }
SecMaxDK, { Max Downld K-bytes }
SecMaxDL, { Max downloads }
SecLevel, { Sec level defines }
SecLevelTime : array[1..MaxSecLevels] of Word; { Time Limits }
SecLevelAnsi : array[1..MaxSecLevels] of Char; { Ansi Menus }
SecLevelRatio : array[1..MaxSecLevels] of Byte; { up/dn ratio }
SecLevelMsg, { Message Access Letters }
SecLevelFile, { DL File Area Access Letters }
SecLevelUpload : Security_Array; {UP File area }
ExtLtr : array[1..10] of Char; {Ext P/Calls}
ExtUpBatch, { Upload batch Names }
ExtDnBatch, { Download Batch Names }
ExtName : array[1..10] of String[12]; { Ext Names }
ExtBatchDriven : array[1..10] of Boolean; { Batch }
ResultCodeMNP, { MNP result codes }
ResultCode : array[R300..R19200] of String[02]; { Normal result codes }
ExtraMemForPageStack, { Extra Page Stack }
ExtraMemForOverlay, { Extra Overlay Buff }
CommIrq, { IRQ used }
CommPort, { Comm Port number}
NodeID, { Node Id number }
ForgroundColor, { Color }
SecTries, { number of password tries allowed }
CWait : Byte; {Carrier Wait time }
TotalLiveProg, { Total live programs }
MinNodeSecurity, { minimum security to access node }
Commbase, { Comm port base address }
Delay1, { Modem Delay Times }
Delay2,
Delay3,
BaudInit, { Baud Rate Initialization }
NewUserSec, { New Users Security level }
Ftimelimit, { First Call time limit }
LinesPage, { Lines per page default }
LogonTimeLimit, { Max time allowed per logon }
CheckBDay, { Verify BDate }
CheckPhone_No, { verify phone }
OverwriteUploads, { Upload overwrite priv. }
UploadComp, { Compensation }
SysopMailSec, { Read Sysop Mail }
TotalMsgConf, { Total Conferences }
TotalFileConf, { total file conferences }
NumOfSecLevels, { number of security levels }
TotalNumOfBulls, { number of bulletins to check }
PreDelay, { Delay before Prelog }
MasterSysop, { Sec for Master sysop }
TotalExtProtocols, { number of external protocols }
TotalQues, { total questionnaires }
MinSecForExternals : Word; { Integers }
PhoneReq, { Newusers - ask for phone }
BDayReq, { Newusers - ask for birthday }
CTypeReq, { Newusers - ask for computer type }
QuesReq, { Newusers - force to questionnaire }
SysopDropToDos, { Sysops are allowed to drop to dos /remote }
ScreenMsgs, { screen all messages }
LeavePrivate, { may leave private messages }
BulletsOptional, { bulletins are optional }
DisplayQuoteDay, { look for quote of the day }
ColorAnsi, { are color scrrens going to be offered }
DropOnExit, { Offhook when f10 }
FixedRate, { Lock DTE }
ShowSec, { show apssword on screen }
ShowPWFiles, { Display Password protected files }
UseClearScreens, { Use clear screens in dynamic screens }
CTSRTSFlowControl, { Modem hardware flow control }
Error60AfterCall, { Drop to errorlevel 60 after call }
UseCharFilter, { filter line noise }
FreeFormPhone, { format phone numbers }
UseExecSwap, { shell exec to ems/disk }
UseEMSForOverlay, { use ems for overlay buffer }
UseEMSForExecSwap, { use ems for exec swap }
OverwriteChatFiles, { reuse chat files }
PromptForAnsi, { Newuser - ask for color }
UseDynamicMenus, { use built in menus }
LogOffIfNotVerified, { log-off for incorrect bday/phone }
LockOutForSecError, { lock out for password error }
PromptToKillRecMsg, { beep to kill received mail }
ReplaceOkByOriginal, { overwrite ok by author }
ShutOffDownloadsIfOverRatio : Boolean; { no more dls }
PageStart, { Sysop Pageing Hours <Start> }
PageEnd, { Sysop Pageing Hours <End> }
StartTime300Baud, { 300 baud start time }
StopTime300Baud : Time; { 300 baud end time }
DateFormat, { date format to use }
TimeFormat : DateString; { time format to use }
end;
User_Record_Type = record
Status : LongInt; { Btree Status }
UserName : String[37]; { Users name }
CallingFrom : String[30]; { location }
Password : String[14]; { Password }
PhoneNumber : String[12]; { User phone number }
ComputerType : String[15]; { Users Computer Type }
ConfJoined : String[26]; { Open Folders }
MorePrompt : More_Prompt_Type; { Erase -MORE- }
Xpert : Expertise_Level; { Xpert level }
TransferMethod : Transfer_Type; { Protocol }
HighMsg : array['A'..'Z'] of Word; { Last read each folder }
LinesPerPage : Byte; { Lines Per Page }
LastNew, { Last New Files Search }
TimeDate : DateTimeRec; { Last time called }
MemoDate, { Extra Date Field }
UserSince, { Date First Called }
BirthDate : Date; { Users Birth Day }
SecurityLevel, { Security level }
Uploads, { Number of ULoads }
Downloads, { Number of DLoads }
TimesOn, { Number times on }
TimeLeft : Word; { Time left today }
DailyDL, { temp counter for daily download count }
DailyDK, { temp counter for daily K-bytes }
TotalUK, { Total K uploaded }
TotalDK : LongInt; { Total K downlded }
ChatPage, { Ok to Page }
HotKey, { Use Hot Keys }
LockedOut, { allowed user? }
ColorMenus : Boolean; { type of graphics }
end;
implementation
end.
====================================================================
BTREE KEY
DECLARATION -
====================================================================
Const
{ UsersFile Index }
RevNameKey = 1;
USecKey = 2;
{DatF Index}
NameKey = 1;
DateKey = 2;
AreaKey = 3;
UploaderKey = 4;
{MessageFile Index}
MsgNumKey = 1;
MsgToKey = 2;
MsgFromKey = 3;
MsgAreaKey = 4;
MsgSubjKey = 5;
In BTree Filer { These MUST BE THE SAME!!! }
MaxNrOfKeys = 5;
MaxKeyLen = 30;
MaxNrOfWorkStations = 250;
PageSize = 62;
MaxHeight = 8;
DatExtension = 'DAT';
IxExtension = 'IX';
DiaExtension = 'DIA';
SavExtension = 'SAV';
MsgExtension = 'MSG';
LockedListBlockSize = 16;
SearchForSequentialDefault : Boolean = True;
NOTE: The WordToKey, Pack6bitKeyUC routines are all included with
the BTree Filer from Turbo Power. They're in there NumKeys Unit.
function TotalKeys(Database : Char) : Byte;
{ Returns the number of keys for each database }
begin
case Database of
'M' : TotalKeys := 5; { Messages }
'F' : TotalKeys := 4; { Files }
'U' : TotalKeys := 2; { Users }
else noteerror('TotalKeys Error: '+Database);
end; { Case}
end;
{ ----------------- Messaage Btree Procedures ------------------}
function MsgSize(TotalLines : Word) : Word;
{ computes the record size based on number of lines }
begin
MsgSize := SizeOf(MsgHeaderOnly_Type)+(TotalLines*81);
end;
function BuildMsgAreaKey(Area : Char; Num : Word) : Str03;
{ Build the Msg Area key, used for folder reading }
begin
BuildMsgAreaKey := Area+WordToKey(Num);
end;
function BuildTFKey(Name : Str15; msgNum : Word) : Str14;
{ Use to create a Message To/From Key }
begin
BuildTFKey := Pack6BitKeyUC(Name,12)+WordToKey(msgNum);
end;
function BuildMsgNumKey(msgNum : Word; Area : Char) : Str03;
{ Build the Msg Number key, used for sequencial reading }
begin
BuildMsgNumKey := WordToKey(msgNum)+Area;
end;
{$F+} function BuildMsgKey(var Rec; KeyNum : Byte) : Str30; {$F-}
{ Shell for Build Msg Keys }
var
MsgRec : Message_Type absolute Rec;
begin
with MsgRec do
case KeyNum of
MsgNumKey : BuildMsgKey := BuildMsgNumKey(MessageNumber, Conference);
MsgToKey : BuildMsgKey := BuildTFKey(switchlast(TO_), MessageNumber);
MsgFromKey : BuildMsgKey := BuildTFKey(SwitchLast(From), MessageNumber);
MsgAreaKey : BuildMsgKey := BuildMsgAreaKey(Conference, MessageNumber);
MsgSubjKey : BuildMsgKey := Pack6BitKeyUC(Subject, 28)+WordToKey(MessageNumber);
end; { Case }
end;
{ ------------------------- File Btree Procedures -----------------------}
function BuildFileNameKey(Name : String) : Str09;
{ used for the file listing }
begin
BuildFileNameKey := Pack6BitKeyUC(Name, 9);
end;
function BuildFileDateKey(DD : DateTimeRec) : Str08;
{ used for new files listing }
begin
BuildFileDateKey := LongToKey(DD.D)+LongToKey(DD.T);
end;
function BuildFileAreaKey(Area : Char;
Name : Str12) : Str10;
{ used for list files, by areas }
begin
BuildFileAreaKey := Area+Pack6BitKeyUC(Name, 9);
end;
function BuildFileKey(var Rec; KeyNum : Byte) : Str30;
{ shell around file key creation }
var
FileRec : File_Record_Type absolute Rec;
begin
with FileRec do
case KeyNum of
NameKey : BuildFileKey := BuildFileNameKey(FileName);
DateKey : BuildFileKey := BuildFileDateKey(FileDate);
AreaKey : BuildFileKey := BuildFileAreaKey(Area, FileName);
UploaderKey : BuildFileKey := SwitchLastKey(UploadedBy, 23);
end; {Case}
end;
{ ------------------------- User BTree Procedures -----------------------}
function SwitchLastKey(Name : Str80; Len : Byte) : Str23;
{ Builds the user name key }
begin
SwitchLastKey := Pack6BitKeyUC(SwitchLast(Name), Len);
end;
{$F+} function BuildUserKey(var Rec; KeyNum : Byte) : Str30; {$F-}
{ Shell around the user database keys }
var
UserRec : User_Record_Type absolute Rec;
begin
with UserRec do
case KeyNum of
RevNameKey : BuildUserKey := SwitchLastKey(UserName, 23);
USecKey : BuildUserKey := WordToKey(SecurityLevel)+(SwitchLastKey(UserName, 5));
end; { Case }
end;
{ ----------------------- General BTree Routines --------------------}
function BuildKey(var Rec; Database : Char; KeyNum : Byte) : Str30;
{ Shell to build all keys on the fly }
begin
case Upcase(Database) of
'M' : BuildKey := BuildMsgKey(Rec, KeyNum);
'F' : BuildKey := BuildFileKey(Rec, KeyNum);
'U' : BuildKey := BuildUserKey(Rec, KeyNum);
end; { Case }
end;
{ ---------------------- Open/Initialize BTree Files ----------------------}
procedure Open_Users(initializing : Boolean);
{ Users Data Base File }
var
FB_Color : Byte;
procedure Create_Users;
var
Keys : IsamIndDescr;
begin
Keys[1].KeyL := 23;
Keys[1].AllowDupK := False;
Keys[2].KeyL := 7;
Keys[2].AllowDupK := True;
MakeNetFileBlock(UsersFile, Cfig.UserDataBasePath+'USERFILE', SizeOf(User), 2, Keys);
if not IsamOK then
case IsamError of
10320 : Log_Fatal_Error('Network Lock Failure Or Share Not Loaded, IsamError);
else
Log_Fatal_Error('ERROR CREATING "USERFILE"', IsamError);
end
else StatusLine('>> Created Users Data Base Files & Indexes <<');
end;
begin
if ColorScreen then FB_Color := 31
else FB_Color := 15;
if ExistFile(Cfig.UserDataBasePath+'USERFILE.DAT') then
begin
repeat
if Cfig.DataBaseOpenMode = SaveMode then
OpenSaveNetFileBlock(UsersFile, Cfig.UserDataBasePath+'USERFILE) else
OpenNetFileBlock(UsersFile, Cfig.UserDataBasePath+'USERFILE');
until LockOk;
if not IsamOK then
case IsamError of
10330 : Log_Fatal_Error('Network Lock Failure Or Share Not Loaded', IsamError);
else
Log_Fatal_Error('ERROR OPENNING "USERFILE"', IsamError);
end;
end
else Create_Users;
TotalUsers := UsedNetRecs(UsersFile);
if initializing then
begin
if Console_Flag then
WriteAT(AddCommas(UsedNetRecs(UsersFile), False), FB_Color, 26, 9);
CloseBtreeFile(UsersFile);
end;
end;
procedure Open_Files(initializing : Boolean);
{ Files Data Base Files }
var
FB_Color : Byte;
procedure Create_Files;
var
Keys : IsamIndDescr;
begin
Keys[1].KeyL := 9;
Keys[1].AllowDupK := False;
Keys[2].KeyL := 8;
Keys[2].AllowDupK := True;
Keys[3].KeyL := 10;
Keys[3].AllowDupK := False;
Keys[4].KeyL := 23;
Keys[4].AllowDupK := True;
MakeNetFileBlock(DatF, Cfig.FileDataBasePath+'FILESPEC', SizeOf(File_Record_Type), 4, Keys);
if not IsamOK then Log_Fatal_Error('ERROR CREATING "FILESPEC"', IsamError)
else StatusLine('>> Created File Menu Index Files <<');
end;
begin
if ColorScreen then FB_Color := 31
else FB_Color := 15;
if ExistFile(Cfig.FileDataBasePath+'FILESPEC.DAT') then
begin
repeat
if Cfig.DataBaseOpenMode = SaveMode then
OpenSaveNetFileBlock(DatF, Cfig.FileDataBasePath+'FILESPEC') else
OpenNetFileBlock(DatF, Cfig.FileDataBasePath+'FILESPEC');
until LockOk;
if not IsamOK then Log_Fatal_Error('ERROR OPENING "FILESPEC"', IsamError);
end
else Create_Files;
TotalFiles := UsedNetRecs(DatF);
if initializing then
begin
if Console_Flag then
WriteAT(AddCommas(UsedNetRecs(DatF), False), FB_Color, 26, 10);
CloseBtreeFile(DatF);
end;
end;
procedure Open_Messages(initializing : Boolean);
{ Message Data Base Files }
var
RInfo : MessageInfo_Type;
FB_Color : Byte;
procedure Create_Messages;
var
Keys : IsamIndDescr;
begin
Keys[1].KeyL := 3;
Keys[1].AllowDupK := False;
Keys[2].KeyL := 14;
Keys[2].AllowDupK := False;
Keys[3].KeyL := 14;
Keys[3].AllowDupK := False;
Keys[4].KeyL := 3;
Keys[4].AllowDupK := False;
Keys[5].KeyL := 30;
Keys[5].AllowDupK := True;
MakeNetFileBlock(MessageFile, Cfig.MsgDataBasePath+'MSGFILE', 256, 5, Keys);
if not IsamOK then Log_Fatal_Error('ERROR Creating "MSGFILE"', IsamError)
else StatusLine('>> Created Message Data Base Files & Indexes <<')
end;
begin
if ColorScreen then FB_Color := 31
else FB_Color := 15;
if ExistFile(Cfig.MsgDataBasePath+'MSGFILE.DAT') then
begin
repeat
if Cfig.DataBaseOpenMode = SaveMode then
OpenSaveNetFileBlock(MessageFile, Cfig.MsgDataBasePath+'MSGFILE') else
OpenNetFileBlock(MessageFile, Cfig.MsgDataBasePath+'MSGFILE');
until LockOk;
if not IsamOK then Log_Fatal_Error('ERROR OPENING "MSGFILE"', IsamError);
if Cfig.DataBaseOpenMode = MarkMode then
ForceWritingMark(True);
end
else Create_Messages;
if initializing then
begin
if UsedNetRecs(MessageFile) = 0 then
begin
ReadBBSFile(RangeFile, 0, RInfo, True);
RInfo.MsgLow := 1;
RInfo.MsgHigh := 0;
RInfo.ActiveMessages := 0;
UpdateBBSFile(RInfo);
end else ReadBBSFile(RangeFile, 0, RInfo, False);
TotalMessages := RInfo.ActiveMessages;
if Console_Flag then
WriteAT(AddCommas(TotalMessages, False), FB_Color, 26, 11);
CloseBtreeFile(MessageFile);
end;
end;
end.
=============================================================================
CALLINFO
=============================================================================
NOTE: We intentionally create a standard text file when we pass control to a
DOOR. The idea behind this was to allow 3rd party developers the
flexibility to read this file using any programming language. We have
noticed several authors read this file into a "fixed array". The
problem is, when we make changes to this format, it is usually at the
bottom of the file, in the form of additional lines. If you are
going to read this file into an array, make the array big enough so
it won't crash if we add a few more lines, down the road. For example,
create an array[1..80] of String[30], then read until EoF (End of File).
Since WILDCAT! only uses 36 lines now, chances are your utility will
work for many years to come before we exceed 80 lines!
procedure Save_Caller_Info;
{ Save the callers information when exiting to a live program or
Dropping to DOS from remote. }
var
FileOut : Text;
DateTime : String;
OldSlash : Char;
begin
Assign(FileOut, HomePath+'CALLINFO.BBS');
Rewrite(FileOut);
CheckError('Rewriting CALLINFO.BBS');
Update_User_Info_Before_LogOff;
with User do
begin
OldSlash := SlashChar;
SlashChar := '/';
WriteLn(FileOut, UserName); { Line 1 }
case Baud of
B300 : WriteLn(FileOut, '1'); { Line 2 }
B1200 : WriteLn(FileOut, '2');
B2400 : WriteLn(FileOut, '0');
B9600 : WriteLn(FileOut, '3');
B19200 : WriteLn(FileOut, '4');
BLocal : WriteLn(FileOut, '5');
B38400 : Writeln(FileOut, '6');
B57400 : Writeln(FileOut, '7');
end;
WriteLn(FileOut, CallingFrom); { Line 3 }
WriteLn(FileOut, SecurityLevel); { Line 4 }
WriteLn(FileOut, User.TimeLeft); { Line 5 }
if ColorMenus then WriteLn(FileOut, 'COLOR')
else { Line 6 }
WriteLn(FileOut, 'MONO');
WriteLn(FileOut, Password); { Line 7 }
WriteLn(FileOut, UserRefNum); { Line 8 }
WriteLn(FileOut, TimeOn); { Line 9 }
WriteLn(FileOut, TimeStr); { Line 10 }
with DateTimeCalled do
DateTime := TimeToTimeString('hh:mm', T)+' '+DatetoDateString('mm/dd/yy', D);
WriteLn(FileOut, DateTime); { Line 11 }
WriteLn(FileOut, ConfJoined); { Line 12 }
WriteLn(FileOut, DailyDL); { Line 13 }
WriteLn(FileOut, Cfig.SecMaxDL[Array_Level]); { Line 14 }
WriteLn(FileOut, Sc(DailyDK)); { Line 15 }
WriteLn(FileOut, Sc(Cfig.SecMaxDK[Array_Level]/1024)); { Line 16 }
WriteLn(FileOut, User.PhoneNumber); { Line 17 }
WriteLn(FileOut, DatetoDateString('mm/dd/yy', TimeDate.D)+Space+
TimeToTimeString('hh:mm', TimeDate.T)); { Line 18 }
if User.Xpert = Novice then WriteLn(FileOut, 'NOVICE')
else { Line 19 }
WriteLn(FileOut, 'EXPERT');
case User.TransferMethod of { Line 20 }
All : WriteLn(FileOut, 'All');
Ymodem : WriteLn(FileOut, 'Ymodem');
YmodemG : WriteLn(FileOut, 'Ymodem/G');
Xmodem : WriteLn(FileOut, 'Xmodem');
XmodemCRC : WriteLn(FileOut, 'Xmodem/CRC');
Xmodem1K : WriteLn(FileOut, 'Xmodem-1K');
Xmodem1KG : WriteLn(FileOut, 'Xmodem-1K/G');
Zmodem : Writeln(FileOut, 'Zmodem');
ASCii : WriteLn(FileOut, 'Ascii');
end;
WriteLn(FileOut, DatetoDateString('mm/dd/yy', LastNew.D)); { Line 21 }
WriteLn(FileOut, Sc(TimesOn)); { Line 22 }
WriteLn(FileOut, Sc(LinesPerPage)); { Line 23 }
WriteLn(FileOut, Sc(UsersHighestMsgRead(HighMsg, ConfJoined))); { Line 24 }
WriteLn(FileOut, Sc(Uploads)); { Line 25 }
WriteLn(FileOut, Sc(Downloads)); { Line 26 }
if DataBits = SevenBits then WriteLn(FileOut, '7 { Databits } ')
else WriteLn(FileOut, '8 { Databits }'); { Line 27 }
if Local then WriteLn(FileOut, 'LOCAL')
else WriteLn(FileOut, 'REMOTE'); { Line 28 }
WriteLn(FileOut, 'COM'+Sc(Cfig.CommPort)); { Line 29 }
WriteLn(FileOut, DatetoDateString('mm/dd/yy', BirthDate)); { Line 30 }
{ Write Comm Port Speed }
if Cfig.FixedRate then WriteLn(FileOut, Cfig.BaudInit)
else
WriteLn(FileOut, BaudRate); { Line 31 }
WriteLn(FileOut, AlreadyConnected); { Line 32 }
if MNP_Connection then WriteLn(FileOut, 'MNP/ARQ Connection')
else WriteLn(FileOut, 'Normal Connection'); { Line 33 }
with GlobalNinfo.TimeOff do
DateTime := DatetoDateString('mm/dd/yy', D)+' '+TimeToTimeString('hh:mm', T);
WriteLn(FileOut, DateTime); { Line 34 }
WriteLn(FileOut, Cfig.NodeID); { Line 35 }
WriteLn(FileOut, DoorNumber); { Line 36 }
SlashChar := OldSlash;
end; { With }
Close(FileOut);
CheckError('Closing CALLINFO.BBS File');
end;
This is what a tipical CALLINFO.BBS file looks like:
Jim Harrer
5
Bakersfield, CA
1000
120
MONO
WCATIS#1
1
0
12:44
12:44 05/08/89 { Changed in v2.x }
ABCDEFGHIJKLMNOYZ
0
100
0
10
555-555-5555
05/08/89 12:44
NOVICE
All
04/24/89
190
23
808
0
2
8 { Databits }
LOCAL
COM0
06/26/58
38400
FALSE
Normal Connection
05/08/89 13:44
1
0
Final Comment: In order to keep track of midnight rollovers, line 11 was
modified in version 2.x to include MM/DD/YY. This may (or may not) affect
some doors.